import unittest
from ffmpeg.options import Options
from ffmpeg.options import build_ffmpeg_args


class OptionsTest(unittest.TestCase):
	
	def setUp(self):
		args1 = '-y -i foobar.avi -b 400 -ab 100 -r 30 -s 400x300 foobar.mp4'
		opts1 = Options()
		opts1.input_filename = 'foobar.avi'
		opts1.output_filename = 'foobar.mp4'
		opts1.video_bitrate = 400
		opts1.audio_bitrate = 100
		opts1.frame_rate = 30
		opts1.frame_width = 400
		opts1.frame_height = 300
		
		self.opts_list = [opts1]
		self.args_list = [args1]
		
	def tearDown(self):
		pass
		
	def test_build_ffmpeg_args(self):
		for opts, args in zip(self.opts_list, self.args_list):
			self.assertEqual(' '.join(build_ffmpeg_args('foobar.avi', 'foobar.mp4', opts)), args)

